
function TitanPanelLyLock1Button_OnLoad()
    this.registry = {
        id = "LyLock1",
        frequency = .5,
        menuText = "Soulstone Info",
        tooltipTitle = "Soulstone Info",
        buttonTextFunction = "TitanPanelLyLock1Plugin_GetButtonText",
        tooltipTitle = "Soulstone Info", 
		tooltipTextFunction = "TitanPanelLyLock1Button_GetTooltipText", 
		icon = "Interface\\AddOns\\LyLockTitan\\GUI\\Soulstone",	
		iconWidth = 16,
		savedVariables = {
			ShowIcon = 1,
			ShowLabelText = 1,
            CooldownInfo = 1,
            PlayersInfo = 1
		}    
  };
end

function TitanPanelRightClickMenu_PrepareLyLock1Menu()
    TitanPanelRightClickMenu_AddTitle(TitanPlugins["LyLock1"].menuText);
    TitanPanelRightClickMenu_AddToggleIcon("LyLock1");
    TitanPanelRightClickMenu_AddSpacer();
  
    local info = {};
	info.text = "Open LyLock Settings";
	info.func = TitanPanelLyLockButton_OpenSettings;
	UIDropDownMenu_AddButton(info);    
    
    TitanPanelRightClickMenu_AddSpacer();
    
    TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE, "LyLock1", TITAN_PANEL_MENU_FUNC_HIDE);
end
function GetSoulstoneText()
    return LyLock_Soulstone.InfoPlayers.." "..LyLock_Soulstone.InfoCooldown;
end
function TitanPanelLyLock1Plugin_GetButtonText()
    return GetSoulstoneText()..".";
end
function TitanPanelLyLock1Button_OnClick(arg1)
	if (arg1 == "LeftButton") then
        if ((GetNumPartyMembers()>0) or (GetNumRaidMembers()>0)) then
            Speak(GetSoulstoneText())
        else
            EchoMessage("LyLock", GetSoulstoneText(), "Soulstone")
        end

	end
end
function TitanPanelLyLock1Button_GetTooltipText()
    return LyLock_Soulstone.InfoCooldown.."\n"..LyLock_Soulstone.InfoPlayers.."\n"..TitanUtils_GetGreenText("Left-Click Announces to Party or Raid");
end


function TitanPanelLyLock2Button_OnLoad()
    this.registry = {
        id = "LyLock2",
        frequency = 1,
        menuText = "Soul Shard Count",
        tooltipTitle = "Soul Shard Count",
        buttonTextFunction = "TitanPanelLyLock2Plugin_GetButtonText",
        tooltipTitle = "Soul Shard Count", 
		tooltipTextFunction = "TitanPanelLyLock2Button_GetTooltipText", 
		icon = "Interface\\AddOns\\LyLockTitan\\GUI\\SoulShard",	
		iconWidth = 16,
		savedVariables = {
			ShowIcon = 1,
			ShowLabelText = 1
		}    
  };
end

function TitanPanelLyLock2Plugin_GetButtonText()
  return LyLock_SoulShard.ToolCount;
end
function TitanPanelLyLock2Button_GetTooltipText()
    return "Soul Shard count display";
end


function TitanPanelRightClickMenu_PrepareLyLock2Menu()

    TitanPanelRightClickMenu_AddTitle(TitanPlugins["LyLock2"].menuText);
    TitanPanelRightClickMenu_AddToggleIcon("LyLock2");
    TitanPanelRightClickMenu_AddSpacer();
  
    local info = {};
	info.text = "Open LyLock Settings";
	info.func = TitanPanelLyLockButton_OpenSettings;
	UIDropDownMenu_AddButton(info);    


    TitanPanelRightClickMenu_AddSpacer();
    
    TitanPanelRightClickMenu_AddCommand(TITAN_PANEL_MENU_HIDE, "LyLock2", TITAN_PANEL_MENU_FUNC_HIDE);
end


function TitanPanelLyLockButton_OpenSettings()
    LyLock_AddOnHandler();
end
